﻿@using RielAp.Translation;
@model RielAp.Domain.Models.Email

@{
    ViewBag.Title = Translation.FeedbackAddTitle;
}


<fieldset>
    <legend>@ViewBag.Title</legend>
    @if (!Html.ViewData.ModelState.IsValid)
    {
        <div class="alert alert-error">
            @foreach (var modelError in Html.ViewData.ModelState.SelectMany(keyValuePair => keyValuePair.Value.Errors))
            {
                <div>@modelError.ErrorMessage</div>
            }
        </div>
    }
    @using (Html.BeginForm("Add", "Feedback", null, FormMethod.Post, new { @class = "form-horizontal", style = "width: 800px;  margin: auto;" }))
    {
        @Html.HiddenFor(m=>m.ParentEmailId)
        <div class="control-group">
            <div class="controls">
                <label class="checkbox inline">
                    @Html.CheckBoxFor(m => m.IsShown) @Translation.ShowFeedbackForAllLabel
                </label>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="Author">@Translation.FeedbackAuthorNameLabel</label>
            <div class="controls">
                @Html.TextBoxFor(m => m.Author, new { placeholder = Translation.FeedbackAuthorNameLabel, style="width: 100%;" })
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="AuthorEmail">@Translation.FeedbackAuthorEmailLabel</label>
            <div class="controls">
                @Html.TextBoxFor(m => m.AuthorEmail, new { placeholder = Translation.FeedbackAuthorEmailLabel, style="width: 100%;" })
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="Subject">@Translation.FeedbackSubjectLabel</label>
            <div class="controls">
                @Html.TextBoxFor(m => m.Subject, new { placeholder = Translation.FeedbackSubjectLabel, style="width: 100%;" })
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="Body">@Translation.FeedbackBodyLabel</label>
            <div class="controls">
                @Html.TextAreaFor(m => m.Body, new { placeholder = Translation.FeedbackBodyLabel, style="width: 100%;" })
            </div>
        </div>
            
        <div class="control-group" id="submitContainer">
            <div class="controls">
                <input type="submit" class="btn " value="@Translation.FeedbackAddButtonLabel">
                @Html.ActionLink(Translation.FeedbackBackToListButtonLabel, "Index",null, new{@class="btn btn-danger"})
            </div>
        </div>
    
    }

</fieldset>


